{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<div class="main">
    <div class="main_title">{%EDIT} <a href="{:u("BmGuardians/index")}" class="back_list">{%BACK_LIST}</a></div>
    <div class="blank5"></div>
    <form name="edit" action="__APP__" method="post" enctype="multipart/form-data">
        <table class="form" cellpadding=0 cellspacing=0>
            <tr>
                <td colspan=2 class="topTd"></td>
            </tr>
            <tr>
                <td class="item_title">名称:</td>
                <td class="item_input"><input type="text" class="textbox require" name="name" value="{$vo.name}"/></td>
            </tr>
            <tr>
                <td class="item_title">大图标:</td>
                <td class="item_input"><html:imgUpload  name="image" id='icon' value="$vo.image"/>
            </td>
            <tr>
                <td class="item_title">小图标:</td>
                <td class="item_input"><html:imgUpload  name="icon" id='icon' value="$vo.icon"/>
            </td>
            </tr>
            <tr>
                <td class="item_title">等级:</td>
                <td class="item_input"><select name="level" data-value="{$vo.level}"><option value="1">1级</option><option value="2">2级</option><option value="3">3级</option></select></td>
            </tr>
            <tr>
                <td class="item_title">积分:</td>
                <td class="item_input"><input type="text" class="textbox" name="score" value="{$vo.score}"/></td>
            </tr>
            <tr>
                <td class="item_title">消费钻石:</td>
                <td class="item_input"><input type="text" class="textbox" name="diamonds" value="{$vo.diamonds}"/></td>
            </tr>
            <tr>
                <td class="item_title">消费游戏币:</td>
                <td class="item_input"><input type="text" class="textbox" name="coins" value="{$vo.coins}"/></td>
            </tr>
            <tr>
                <td class="item_title" id="get_ticket">{%TICKET_NUMBER}:</td>
                <td class="item_input">
                    <input type="text" class="textbox" name="ticket" value="{$vo.ticket}"/>
                    <span class="tip_span" id="tip_ticket">&nbsp;主播可以获得的{%TICKET_NUMBER}</span>
                </td>
            </tr>	
            <tr>
                <td class="item_title">{%IS_EFFECT}:</td>
                <td class="item_input">
                    <label>{%IS_EFFECT_1}<input type="radio" name="is_effect" value="1" <if condition="$vo['is_effect'] eq 1">checked="checked"</if>  /></label>
                    <label>{%IS_EFFECT_0}<input type="radio" name="is_effect" value="0" <if condition="$vo['is_effect'] eq 0">checked="checked"</if> /></label>
                </td>
            </tr>
            <tr>
                <td class="item_title">{%SORT}:</td>
                <td class="item_input"><input type="text" class="textbox" name="sort" value="{$vo.sort}" /></td>
            </tr>
            <tr>
                <td class="item_title"></td>
                <td class="item_input">
                    <!--隐藏元素-->
                    <input type="hidden" name="{:conf("VAR_MODULE")}" value="BmGuardians" />
                           <input type="hidden" name="{:conf("VAR_ACTION")}" value="update" />
                           <input type="hidden" name="id" value="{$vo.id}" />
                    <!--隐藏元素-->
                    <input type="submit" class="button" value="{%EDIT}" />
                    <input type="reset" class="button" value="{%RESET}" />
                </td>
            </tr>
            <tr>
                <td colspan=2 class="bottomTd"></td>
            </tr>
        </table>
        <input name="ticket_name" id="ticket_name" type="hidden" value="{%TICKET_NUMBER}"/>
    </form>
    <script>
        $(function () {
            var ticket_name = $("#ticket_name").val();
            if ($("input[name='is_red_envelope']:checked").val() == 1) {
                $('#get_ticket').html('钻石数量');
                $('#tip_ticket').html('&nbsp;主播可以单独获得的钻石数量，消费钻石扣除该数量后供观众抢');
                $('#robot_diamonds').html('机器人获得钻石');
                $('#tip_robot_diamonds').html('&nbsp;观众实际可抢钻石=diamonds(消费钻石)-主播独立获得-机器人获得 【直播没机器人,平台直接收取】');
                $("input[name='diamonds']").addClass('require');
            } else {
                $('#get_ticket').html(ticket_name);
                $('#tip_ticket').html('&nbsp;主播可以获得的' + ticket_name);
                $("input[name='diamonds']").removeClass('require');
            }

            $("input[name='is_animated']").bind("click", function () {
                var val = $("input[name='is_animated']:checked").val();
                if (val == 2) {
                    $("#is_animated_anim_type").show();
                } else {
                    $("#is_animated_anim_type").hide();
                }
            });
            $('select').each(function(){
                var $sel=$(this);
                var val=$sel.data('value');
                if(val){
                    $sel.find('option[value="'+val+'"]').prop('selected',true);
                }
            })
        });

    </script>
</div>
<include file="Public:footer" />